% save code by :ANSI
function v = fensu(t)
    v1 = 8; %基本风速
    vg = vg1(t); %阵风风速
    vr = vr1(t); %渐变风风速
    vn = vn1(t); %随机风风速
    v = v1 + vg + vr + vn; %组合风风速
end

function vg = vg1(t)
    % Tg = 10
    % tg1 = 5
    % vgmax = 3
    vg = 0 .* (t < 5) + 1.5 * (1 - cos(2 * pi * ((t - 5) / 10))) .* (t >= 5 & t <= 15) +0 .* (t > 15);
end

function vr = vr1(t)
    % vrmax = 2
    % tr1 = 5
    % tr2 = 35
    vr = 0 .* (t < 5) + (1/15) * (t - 5) .* (t >= 5 & t <= 35) +2 .* (t > 35);
end

function vn = vn1(t)
    % vnmax = 1
    % 这个是错的
    vn = 1 * (-rand(1, 1)) * cos(pi * t + 2 * pi * rand(1, 1));
end
